package com.gy.mapper;

import com.gy.entity.*;
import com.gy.entity.Error;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface DataMapper {

    public User login(String username, String password);

    public void register(String username, String password);

    List<Question> getQuestion(String type);

    User searchByUsername(String username);

    void collect(String questionId, String userId);

    Collect searchCollect(String questionId, String userId);

    Error searchError(String questionId, String userId);

    void error(String questionId, String userId);

    List<Question> selectAllQuestion();

    void delete(Integer id);

    void add(Question question);

    Question searchQuestById(Integer id);

    void save(Question question);

    User adminLogin(String username, String password);

    List<Question> searchCollectByUser(String userId);

    List<Question> searchErrorByUser(String userId);

    List<Video> searchVideo(String type);

    Detail detail(String id);

    List<Detail> searchAllDetail();

    Detail searchByTitle(String title);

    List<Question> getAndroidQuestion(String type);

    List<Question> selectAllAndroidQuestion();

    void addToAndroid(Question question);

    void deleteToAndroid(Integer id);

    Question searchAndroidQuestById(Integer id);

    void saveToAndroid(Question question);
}
